/**
 * @param params
 * @description 获取广告位列表
 */
export function ads() {
  return new Promise((resolve,reject) => {
    axios({
      method:'get',
      url:'/wechat/ads',
    }).then((res)=>{
      resolve(res.data)
    }).catch((error)=>{
      reject(error)

    })
  })
}
export function getBrokers() {
  return new Promise((resolve,reject) => {
    axios({
      method:'get',
      url:'/wechat/brokers',
    }).then((res)=>{
      resolve(res.data)
    }).catch((error)=>{
      reject(error)

    })
  })
}
/**
 * @param params
 * @description 获取职位信息
 */
export function getPositons(params) {
  return new Promise((resolve,reject) => {
    axios.get('/wechat/positions',{params:params}).then((res)=>{
      resolve(res.data)
    }).catch((error)=>{
      reject(error)

    })
  })
}
/**
 * @param params
 * @description 搜索职位
 */
export function searchJobs(params) {
  return new Promise((resolve,reject) => {
    let data = Qs.stringify({
      keyword:params.keyword,
      index:params.index,
      num:params.num,
      location:params.location
    });
    axios({
      method:'POST',
      url:'/wechat/zgzCompanyPositionData/search',
      data:data
    }).then((res)=>{
      resolve(res.data)
    }).catch((error)=>{
      reject(error)

    })
  })
}
/**
 * @param params
 * @description 获取微信鉴权嘛
 */
export function getVcode(params) {
  return new Promise((resolve,reject) => {
    let data = {
      phone:params.phone,
    };
    axios({
      method:'POST',
      url:'/wechat/vcode',
      data:data
    }).then((res)=>{
      resolve(res.data)
    }).catch((error)=>{
      reject(error)

    })
  })
}
/**
 * @param params
 * @description 绑定用户信息
 */
export function bindUserInfo(params) {
  return new Promise((resolve,reject) => {
    let data = {
      userName:params.name,
      userPhone:params.phone,
      vcode:params.vcode,
      fissionKey:params.fissionKey
    }
    axios({
      method:'PUT',
      url:'/wechat/userPhone',
      data:data
    }).then((res)=>{
      resolve(res.data)
    }).catch((error)=>{
      reject(error)
    })
  })
}
/**
 * @param positionId
 * @description 查询职位详情
 */
export function getPosDetails(positionId) {
  return new Promise((resolve,reject) => {
    axios({
      method:'get',
      url:'/wechat/positions/'+positionId
    }).then((res)=>{
      resolve(res.data)
    }).catch((error)=>{
      reject(error)
    })
  })
}
/**
 * @param positionId
 * @description 查询职位详情
 */
export function getCompanyDetails(companyId) {
  return new Promise((resolve,reject) => {
    axios({
      method:'get',
      url:'/wechat/zgzCompany/'+companyId
    }).then((res)=>{
      resolve(res.data)
    }).catch((error)=>{
      reject(error)
    })
  })
}
/**
 * @description 查询热门企业
 */
export function getHotCompany() {
  return new Promise((resolve,reject) => {
    axios({
      method:'get',
      url:'/wechat/isHotCompanys',
    }).then((res)=>{
      resolve(res.data)
    }).catch((error)=>{
      reject(error)
    })
  })
}
/**
 * @description 查询热门企业
 */
export function getHotTag() {
  return new Promise((resolve,reject) => {
    axios({
      method:'get',
      url:'/wechat/positonsTag',
    }).then((res)=>{
      resolve(res.data)
    }).catch((error)=>{
      reject(error)
    })
  })
}
/**
 * @param params
 * @description 提交微信个人信息
 */
export function wechatInfo(params) {
  return new Promise((resolve,reject) => {
    let data = {
      nickName:params.nickName,
      openid:params.openid,
      headimgurl:params.headimgurl,
    }
    axios({
      method:'post',
      url:'/wechat/bindInfo',
      data:data
    }).then((res)=>{
      resolve(res.data)
    }).catch((error)=>{
      reject(error)
    })
  })
}
/**
 * @param positionId
 * @description 职位报名
 */
export function positonSignUp(positionId) {
  return new Promise((resolve,reject) => {
    let data = {
      positionId:positionId
    }
    axios({
      method:'post',
      url:'/wechat/signup',
      data:data
    }).then((res)=>{
      resolve(res.data)
    }).catch((error)=>{
      reject(error)
    })
  })
}
/**
 * @param positionId
 * @description 获取用户信息
 */
export function zgzUser() {
  return new Promise((resolve,reject) => {
    axios({
      method:'get',
      url:'/wechat/userInfo'
    }).then((res)=>{
      resolve(res.data)
    }).catch((error)=>{
      reject(error)
    })
  })
}
/**
 * @param positionId
 * @description 完善个人信息
 */
export function wxBindingInfo(params) {
  return new Promise((resolve,reject) => {
    axios({
      method:'PUT',
      url:'/wechat/userInfo',
      data:params
    }).then((res)=>{
      resolve(res.data)
    }).catch((error)=>{
      reject(error)
    })
  })
}
/**
 * @param positionId
 * @description 推荐好友
 */
export function zgzCompanyUserRc(params) {
  return new Promise((resolve,reject) => {
    let data = {
      recmdedName:params.recmdedName,
      recmdedDomicile:params.recmdedDomicile,
      recmdedPhone:params.recmdedPhone,
    }
    axios({
      method:'post',
      url:'/wechat/zgzCompanyUserRc',
      data:data
    }).then((res)=>{
      resolve(res.data)
    }).catch((error)=>{
      reject(error)
    })
  })
}
/**
 * @param positionId
 * @description 推荐宣传
 */
export function zgzRcInfo() {
  return new Promise((resolve,reject) => {
    axios({
      method:'get',
      url:'/wechat/zgzRcInfo'
    }).then((res)=>{
      resolve(res.data)
    }).catch((error)=>{
      reject(error)
    })
  })
}
//获取门店列表
export function getStoreList(params) {
  return new Promise((resolve,reject) => {
    axios.get('/wechat/stores',{params:params}).then((res)=>{
      resolve(res.data)
    }).catch((error)=>{
      reject(error)

    })
  })
}

// 获取后勤商品列表
export function getGoodsList() {
  return new Promise((resolve,reject) => {
    axios({
      method:'get',
      url:'/wechat/goods'
    }).then((res)=>{
      resolve(res.data)
    }).catch((error)=>{
      reject(error)
    })
  })
}

/**
 * @param positionId
 * @description 提交订单(商品购物车)
 */
export function commitOrder(params) {
  return new Promise((resolve,reject) => {
    axios({
      method:'post',
      url:'/wechat/order',
      data: params
    }).then((res)=>{
      resolve(res.data)
    }).catch((error)=>{
      reject(error)
    })
  })
}

// 获取工资列表
export function getSalarys() {
  return new Promise((resolve,reject) => {
    axios({
      method:'get',
      url:'/wechat/salarys'
    }).then((res)=>{
      resolve(res.data)
    }).catch((error)=>{
      reject(error)
    })
  })
}

// 获取返费
export function getReturnFees() {
  return new Promise((resolve,reject) => {
    axios({
      method:'get',
      url:'/wechat/returnFees'
    }).then((res)=>{
      resolve(res.data)
    }).catch((error)=>{
      reject(error)
    })
  })
}
// 获取推荐费
export function getRecommends() {
  return new Promise((resolve,reject) => {
    axios({
      method:'get',
      url:'/wechat/recommends'
    }).then((res)=>{
      resolve(res.data)
    }).catch((error)=>{
      reject(error)
    })
  })
}

// 获取推荐码
export function getCode() {
  return new Promise((resolve,reject) => {
    axios({
      method:'get',
      url:'/wechat/spreadCode'
    }).then((res)=>{
      resolve(res.data)
    }).catch((error)=>{
      reject(error)
    })
  })
}
// 获取推荐规则
export function getCodeRule() {
  return new Promise((resolve,reject) => {
    axios({
      method:'get',
      url:'/wechat/rddSpreadRule/1'
    }).then((res)=>{
      resolve(res.data)
    }).catch((error)=>{
      reject(error)
    })
  })
}
// 获取邀新列表
export function getSpread() {
  return new Promise((resolve,reject) => {
    axios({
      method:'get',
      url:'/wechat/spread'
    }).then((res)=>{
      resolve(res.data)
    }).catch((error)=>{
      reject(error)
    })
  })
}

/**
 * @param positionId
 * @description 门店加盟
 */
export function commitStore(params) {
  return new Promise((resolve,reject) => {
    axios({
      method:'post',
      url:'/wechat/store',
      data: params
    }).then((res)=>{
      resolve(res.data)
    }).catch((error)=>{
      reject(error)
    })
  })
}

// 获取当前用户报工信息
export function getIsSignUp() {
  return new Promise((resolve,reject) => {
    axios({
      method:'get',
      url:'/wechat/isSignUp'
    }).then((res)=>{
      resolve(res.data)
    }).catch((error)=>{
      reject(error)
    })
  })
}

/*
  获取加盟店列表
*/
export function getUserStores() {
  return new Promise((resolve,reject) => {
    axios({
      method:'get',
      url:'/wechat/userStores'
    }).then((res)=>{
      resolve(res.data)
    }).catch((error)=>{
      reject(error)
    })
  })
}

/*
  获取用户状态
*/
export function getUserStatus() {
  return new Promise((resolve,reject) => {
    axios({
      method:'get',
      url:'/wechat/userStatus'
    }).then((res)=>{
      resolve(res.data)
    }).catch((error)=>{
      reject(error)
    })
  })
}

/*
  获取合作加盟信息
*/
export function getJoinInfo() {
  return new Promise((resolve,reject) => {
    axios({
      method:'get',
      url:'/wechat/joinInfo'
    }).then((res)=>{
      resolve(res.data)
    }).catch((error)=>{
      reject(error)
    })
  })
}